# list=['a','b','c','d','e']
# print(list[10:])

# dict1 = {"a":20,"b":30}
#
# for item in dict1.items():
#     print(item[0])

# def f(x,l=[]):
#     for i in range(x):
#         l.append(i*i)
#     print(l)
#
# f(3)
# class Parent(object):
#     x=1
# class Child1(Parent):
#     pass
#
# class Child2(Parent):
#     pass
#
# print(Parent.x,Child1.x,Child2.x)
# Child1.x=2
# print(Parent.x,Child1.x,Child2.x)
# Parent.x=3
# print(Parent.x,Child1.x,Child2.x)

# def multi():
#     return [lambda x: i*x for i in range(4)]
# print([m(2) for m in multi()])

def gen():
    x=0
    while True:
        x=yield x*x
a=gen()
next(a)
for i in range(5):
    print(a.send(i))
